package com.ash.reflect;

import java.lang.reflect.Method;
import java.lang.reflect.Parameter;

public class Test {

    public static void main(String[] args) throws NoSuchMethodException {
        Class<User> userClass = User.class;
        System.out.println(userClass.getName());
        System.out.println(userClass.getSimpleName());
        System.out.println(userClass.getMethod("getName"));
        Method setName = userClass.getMethod("setName", String.class);
        System.out.println(setName);

        Parameter[] parameters = setName.getParameters();
        for (Parameter parameter : parameters) {
            System.out.println(parameter);
        }
    }
}
